<%--
  Created by IntelliJ IDEA.
  User: 叶叶
  Date: 2022/2/19
  Time: 17:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>计划审核</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.js"></script>
    <script src="../js/bootstrap-table-zh-CN.min.js"></script>
</head>
<body>
<div class="container" id="div1">
    <span style="color: blue;font-family: 华文宋体"><marquee width=400 direction=left align=middle><span>您正在做的业务是：生产管理--生产计划管理--生产计划审核
</span></marquee></span>
    <!--      <div class="row" style="margin-top: 20px">-->
    <!--          <div class="col-10">-->
    <!--          </div>-->
    <!--          <div class="col-2">-->
    <!--              <button class="btn btn-primary" data-toggle="modal" data-target="#myModal" onclick="add1()">添加</button>-->
    <!--          </div>-->
    <!--      </div>-->
    <div class="container">
        <div class="row">
            <caption>
                <div style="float: right;margin-bottom: 5px">
                </div>
            </caption>
            <table id="table" class="table table-hover table-bordered" style="width: 1100px">
                <thead>
                <tr align="center">
                    <th>生产计划编号</th>
                    <th>计划制定人</th>
                    <th>登记人</th>
                    <th>登记时间</th>
                    <th>备注</th>
                    <th>审核</th>
                </tr>
                </thead>
                <tbody>

            </table>
        </div>
    </div>
</div>
</div>

<DIV class=DIV_STYLE2 id="div2" style="display: none"><TABLE cellSpacing=0 cellPadding=0 width=350 align=center bgColor=#ffffff border=0>
    <div style="position: relative;left: 60%">

        <input class="RADIO_STYLE1" name="tg"  type="radio" value="S001-2">未通过
        <input class="RADIO_STYLE1" name="tg"  type="radio" value="S001-1">通过
        <input  onclick="queren()" class="btn3_mouseout" type=button value=确认>
        <input  onclick="fanhui()" class="btn3_mouseout" type=button value=返回>
    </div>
    <TBODY>
    <TR>
        <TD class=TABLE_STYLE6 vAlign=bottom rowSpan=2 align=center>
            <TABLE style="BORDER-TOP: #333333 1px solid; BORDER-RIGHT: #333333 1px solid; BORDER-BOTTOM: #333333 1px solid; BORDER-LEFT: #333333 1px solid" cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TBODY>
                <TR>
                    <TD height=10 colSpan=4>
                        <TABLE width="100%">
                            <TBODY>
                            <TR>
                                <TD>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center>&nbsp;</TD></TR></TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center><FONT size=4><B>生产计划单</B></FONT></TD></TR></TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center>&nbsp;</TD></TR></TBODY></TABLE>
                                    <TABLE id=theObjTable class=TABLE_STYLE4 align=center><INPUT type=hidden name=designer>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE8 borderColorLight=#848284 width="40%" borderColorDark=#eeeeee align=right>计划单编号：</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="89%" align=left><span id="jhd"></span></TD></TR></TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center>&nbsp;</TD></TR></TBODY></TABLE>
                                    <TABLE width="1000" id="table2" class=TABLE_STYLE5 borderColor=#000000 cellSpacing=0 borderColorDark=#eeeeee cellPadding=0 align=center borderColorLight=#848284 border=1>
                                        <TBODY>
                                        <TR class=TR_STYLE2 height=20 bgColor=#d2e9ff>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="11%" align=left>产品编号</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="13%" align=left>产品名称</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="11%" align=left>描述</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="13%" align=left>数量</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="48%" colSpan=4 align=left>出库单编号集合</TD></TR>



                                        </TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center>&nbsp;</TD></TR></TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE8 borderColorLight=#848284 width="10%" borderColorDark=#eeeeee align=right>登记人&nbsp;&nbsp;：</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="40%" align=left><label>
                                                <INPUT class=INPUT_STYLE3 value="" name=register id="djr">
                                            </label></TD>
                                            <TD class=TD_STYLE8 borderColorLight=#848284 width="10%" borderColorDark=#eeeeee align=right>登记时间：</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="40%" align=left><span id="djsj"></span></TD></TR>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE8 borderColorLight=#848284 width="10%" borderColorDark=#eeeeee align=right>审核人&nbsp;&nbsp;：</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="40%" align=left><INPUT class=INPUT_STYLE3 value="" name=checker id="shr"></TD>
                                            <TD class=TD_STYLE8 borderColorLight=#848284 width="10%" borderColorDark=#eeeeee align=right>审核时间：</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="40%" align=left><span id="shsj"></span></TD></TR>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE8 borderColorLight=#848284 width="10%" borderColorDark=#eeeeee align=right>备注&nbsp;&nbsp;&nbsp;&nbsp;：</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 width="89%" colSpan=3 align=left><TEXTAREA class=TEXTAREA_STYLE1 rows=4 cols=125 name=remark id="bz"></TEXTAREA> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
                <TR>
                    <TD width=56 colSpan=3 noWrap></TD></TD></TR>
                <TR>
                    <TD height=100 colSpan=3 noWrap></TD>
                    <TD></TD></TR>
                <TR vAlign=bottom>
                    <TD colSpan=4 noWrap align=center></TD></TR></TD>
                <TR>
                    <TD colSpan=4 noWrap align=right></TD></TR></TBODY></TABLE></TD>
        <TD bgColor=#ffffff height=2 width=1></TD>
        <TD bgColor=#ffffff height=2 width=1></TD>
        <TD bgColor=#ffffff height=2 width=1></TD></TR>
    <TR>
        <TD bgColor=#333333 height=120 width=1></TD>
        <TD bgColor=#666666 height=120 width=1></TD>
        <TD bgColor=#999999 height=120 width=1></TD></TR>
    <TR align=right vAlign=top>
        <TD colSpan=4>
            <TABLE class=TABLE_STYLE6 cellSpacing=0 cellPadding=0 align=center border=0>
                <TBODY>
                <TR>
                    <TD bgColor=#333333 height=1></TD></TR>
                <TR>
                    <TD bgColor=#666666 height=1></TD></TR>
                <TR>
                    <TD bgColor=#999999 height=1></TD></TR></TBODY></TABLE></TD></TR>
    <TR align=right vAlign=middle>
        <TD colSpan=4></TD></TR></TBODY></TABLE></DIV>
<script>
    $(function () {
        $("#table").bootstrapTable({
            method: "post",
            //请求类型
            contentType: "application/json",
            //请求地址
            url: "/cha/chajh/",
            striped: true,
            //初始页数
            pageNumber: 1,
            pagination: true,
            sidePagination: "server",
            pageSize: 2,
            pageList: [2, 4, 6, 8, 10],
            queryParams: function (param) {
                return {
                    page: (param.offset / param.limit) + 1,
                    pageNum: param.limit
                }
            },
            columns: [
                {title: "生产计划编号", field: "applyId", align: "center"},
                {title: "计划制定人", field: "", align: "center"},
                {title: "登记人", field: "register", align: "center"},
                {title: "登记时间", field: "registerTime", align: "center"},
                {title: "备注", field: "remark", align: "center"},
                {title: "审核", field: "", align: "center",
                    formatter: function (value, row, index) {
                        var btn2 = "<a href='#' onclick='shenghe("+row.applyId+")'>审核</a>";
                        return btn2;
                    }
                }
            ]
        })
    })
    function shenghe(applyId) {
            document.getElementById("div1").style.display='none'
            document.getElementById("div2").style.display='block'
            $.ajax({
                type:"get",
                url: "/cha/sh1/"+applyId,
                dataType:"json",
                success:function (data) {
                    var myDate = new Date();
                    year = myDate.getYear()+1900;
                    month = myDate.getMonth()+1;
                    date = myDate.getDate();
                    hour = myDate.getHours();
                    minute =myDate.getMinutes();
                    second = myDate.getSeconds();
                    document.getElementById("shsj").innerText=year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second
                    document.getElementById("jhd").innerText=applyId
                    document.getElementById("djr").value=data[0].register
                    document.getElementById("shr").value=data[0].register
                    document.getElementById("djsj").innerText=data[0].registerTime
                    for (var i=0;i<data.length;i++){
                        document.getElementById("table2").innerHTML+=
                            "<tr>"+
                                "<td>"+data[i].productId+"</td>"+
                            "<td>"+data[i].productName+"</td>"+
                            "<td></td>"+
                            "<td>"+data[i].amount+"</td>"+
                            "<td></td>"+
                            "<tr>"
                    }
                }
            })
    }
    function fanhui() {
        document.location="planreview.jsp"
    }
    function queren() {
        var aa = document.getElementsByName("tg");
        let checker = document.getElementById("shr").value;
        let checkTime = document.getElementById("shsj").innerText;
        let applyId = document.getElementById("jhd").innerText;
        let checkSuggestion = document.getElementById("bz").value;
        for (var i=0; i<aa.length; i++)
        {
            if(aa[i].checked) {
                var checkTag = aa[i].value;
            }
        }
        var xxx={
            checkTag:checkTag,
            checker:checker,
            checkTime:checkTime,
            applyId:applyId,
            checkSuggestion:checkSuggestion
        }
            $.ajax({
                type: "post",
                dataType: "json",
                data:JSON.stringify(xxx),
                contentType: "application/json",
                url:"/cha/xgjh/",
                success:function (data) {
                    document.location="planreview.jsp"
                }
            })
    }
</script>
</body>
</html>
